package com.ansion.adapter.list;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;

import com.ansion.adapter.IAdapterData;


public interface ITurboListItem<T extends IAdapterData, VH extends TurboListAdapter.ViewHolder<T>> {

    int getType();

    @LayoutRes
    int getLayoutRes();

    @NonNull
    VH getViewHolder(View v);

    @NonNull
    default VH getVH(ViewGroup v) {
        return getViewHolder(LayoutInflater.from(v.getContext()).inflate(getLayoutRes(), v, false));
    }
}
